import Vue from 'vue'
import Vuex from 'vuex'
 
Vue.use(Vuex)
 
let store = new Vuex.Store({
    state: {
        lastDrawHistory: {
            paths: [],
            lastEditName: ''
        }
    },
    getters : {
        getLastDrawHistory(state) {
            return state.lastDrawHistory
        }
    },
    mutations: {
        SET_LAST_DRAW_HISTORY(state,payLoad) {
            state.lastDrawHistory.paths = payLoad.paths
            state.lastDrawHistory.lastEditName = payLoad.lastEditName
        }
    },
    actions: {
        setLastDrawHistoryActions({commit}, payLoad) {
            commit('SET_LAST_DRAW_HISTORY', payLoad)
        }
    }
})
 
export default store
